﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;

namespace Mysoft.QuickCode.Common
{
    /// <summary>
    /// 分页参数对象
    /// </summary>
    public class Pager
    {
        public Pager()
        {
            this.PageNow = 1;
            this.PageSize = 20;
        }

        /// <summary>
        /// 当前页，
        /// </summary>
        public int PageNow { set; get; }

        /// <summary>
        /// 分页大小
        /// </summary>
        public int PageSize { set; get; }
        /// <summary>
        /// 自定义分页排序字段
        /// </summary>
        public string OrderBy { set; get; }
        /// <summary>
        /// 默认分页排序字段
        /// </summary>
        public string DefaultOrderBy { set; get; }
    }

    /// <summary>
    /// 泛型分页数据对象
    /// </summary>
    /// <typeparam name="T"></typeparam>
    public class Pager<T>
    {
        public Pager()
            : base()
        {
            this.Total = 0;
            this.Rows = new List<T>();
        }
        public int Total { set; get; }
        public List<T> Rows { set; get; }
    }

    /// <summary>
    /// 非泛型的分页数据对象
    /// </summary>
    public class TablePager {
        public TablePager()
            : base()
        {
            this.Total = 0;
        }
        /// <summary>
        /// 总记录数
        /// </summary>
        public int Total { set; get; }

        /// <summary>
        /// 当前页数据列表
        /// </summary>
        public DataTable Table { set; get; }
    }
    
}
